package com.newhopegroup.webcommons.utils;

import com.google.gson.Gson;

/**
 * Created by wangshida on 15/10/20.
 */
public class JsonHelper {
    public static String toJson(Object o) {
        Gson gson = new Gson();
        return gson.toJson(o);
    }

    public static <T> T fromJson(String s, Class<T> c) {
        Gson gson = new Gson();
        return gson.fromJson(s, c);
    }
}
